<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns most recent OpenSSL error reported on the buffer event</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="eventbufferevent.setwatermark.html">« EventBufferEvent::setWatermark</a></li>
      <li style="float: right;"><a href="eventbufferevent.sslfilter.html">EventBufferEvent::sslFilter »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.eventbufferevent.html">EventBufferEvent</a></li>
    <li>Returns most recent OpenSSL error reported on the buffer event</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="eventbufferevent.sslerror" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventBufferEvent::sslError</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBufferEvent::sslError</span> &mdash; <span class="dc-title">Returns most recent OpenSSL error reported on the buffer event</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventbufferevent.sslerror-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventBufferEvent::sslError</strong></span>(): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Returns most recent OpenSSL error reported on the buffer event.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    This function is available only if
    <code class="literal">Event</code>
    is compiled with OpenSSL support.
   </p>
  </p></blockquote>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventbufferevent.sslerror-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-eventbufferevent.sslerror-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns OpenSSL error string reported on the buffer event, or <strong><code>false</code></strong>, if
   there is no more error to return.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-eventbufferevent.sslerror-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-4243">
   <p><strong>示例 #1 
    <span class="function"><strong>EventBufferEvent::sslError()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;This&nbsp;callback&nbsp;is&nbsp;invoked&nbsp;when&nbsp;some&nbsp;even&nbsp;occurs&nbsp;on&nbsp;the&nbsp;event&nbsp;listener,<br />//&nbsp;e.g.&nbsp;connection&nbsp;closed,&nbsp;or&nbsp;an&nbsp;error&nbsp;occurred<br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">ssl_event_cb</span><span style="color: #007700">(</span><span style="color: #0000BB">$bev</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$events</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$ctx</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$events&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">ERROR</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Fetch&nbsp;errors&nbsp;from&nbsp;the&nbsp;SSL&nbsp;error&nbsp;stack<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">while&nbsp;(</span><span style="color: #0000BB">$err&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$bev</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sslError</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">fprintf</span><span style="color: #007700">(</span><span style="color: #0000BB">STDERR</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Bufferevent&nbsp;error&nbsp;%s.\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$err</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$events&nbsp;</span><span style="color: #007700">&amp;&nbsp;(</span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">EOF&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">ERROR</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$bev</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">free</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-eventbufferevent.sslerror-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="eventbufferevent.sslrenegotiate.html" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::sslRenegotiate()</a> - Tells a bufferevent to begin SSL renegotiation</span>
   </li>
  </ul>
 </div>

</div></div></div></body></html>